home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / ABUSESRC.ZIP / AbuseSrc / imlib / port / unix / timing.c < prev   
Encoding:
C/C++ Source or Header  |  1995-07-23  |  584 b   |  30 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <sys/time.h>
  4. #include <unistd.h>
  5. #include "timing.hpp"
  6.  
  7. void timer_init() { ; }
  8. void timer_uninit() { ; }
  9.  
  10.  
  11. double time_marker::diff_time(time_marker *other)
  12. {  
  13.   return (double)(seconds-other->seconds)+  (double)(micro_seconds-other->micro_seconds)/1000000;
  14. }
  15.  
  16. void time_marker::get_time()
  17. {
  18.   struct timezone tz={0,DST_USA};     
  19.   gettimeofday((struct timeval *)&seconds,&tz);
  20. }
  21.  
  22. time_marker::time_marker()
  23. { get_time(); }
  24.  
  25. void milli_wait(unsigned wait_time)
  26. {
  27.   usleep((long)wait_time*(long)1000);
  28. }
  29.  
  30.